/*
package cn.source.web.controller.accountWeb;

import cn.source.system.account.dto.TenantRoleDTO;
import cn.source.system.account.service.RoleService;
import cn.source.system.common.domain.vo.JsonResult;
import cn.source.system.config.security.CurrUserDetails;
import com.taobao.api.ApiException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

*/
/**
 * 角色控制层
 * <p>RoleController.java此类用于处理角色相关业务</p>
 * <p>@author:孔得峰</p>
 * <p>@date:2018年11月16日</p>
 *//*

@RestController
@RequestMapping
public class RoleController {

    @Autowired
    private RoleService roleService;

    */
/**
     * 查询当前用户所属租户的角色列表
     * @return
     * @author:YXZhou
     *//*

    @GetMapping(value = "/tenant/role/list")
    public JsonResult queryTenantRoleList() {
        CurrUserDetails userDetails = (CurrUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        List<TenantRoleDTO> tenantRoleDtoList = roleService.queryTenantRole(userDetails.getTenantId());
        return JsonResult.ok(tenantRoleDtoList);
    }

    */
/**
     * 添加角色
     * @param role
     * @return
     * @author YXZhou
     *//*

    @PostMapping(value = "/role")
    public JsonResult add(TenantRoleDTO role) {
        CurrUserDetails userDetails = (CurrUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        roleService.createTenantRole(userDetails.getTenantId(), role);
        return JsonResult.ok();
    }

    */
/**
     * 修改角色
     * @param role
     * @return
     * @author YXZhou
     *//*

    @PutMapping(value = "/role")
    public JsonResult update(TenantRoleDTO role) {
        CurrUserDetails userDetails = (CurrUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        roleService.modifyTenantRole(userDetails.getTenantId(), role);
        return JsonResult.ok();
    }


    */
/**
     * 删除角色
     * @param code
     * @return
     * @author YXZhou
     *//*

    @DeleteMapping(value = "/role/{code}")
    public JsonResult delete(@PathVariable("code") String code) {
        CurrUserDetails userDetails = (CurrUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        roleService.removeTenantRole(userDetails.getTenantId(), code);
        return JsonResult.ok();
    }


    */
/**
     * 查询登录所用租户的所有权限
     * @return
     * @author YXZhou
     * @throws ApiException
     *//*

    @GetMapping(value = "/role/privilegeTree")
    public Map<String, Object> queryPrivilegeTree() throws ApiException {
        CurrUserDetails userDetails = (CurrUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        Map<String, Object> returnMap = roleService.queryPrivilegeTree(userDetails.getTenantType());
        return returnMap;
    }

    */
/**
     * 查询已有权限
     * @return
     * @author YXZhou
     *//*

    @GetMapping(value = "/role/queryBindPrivilege/{code}")
    public Map<String, Object> queryBindPrivilege(@PathVariable("code") String code) {
        Map<String, Object> returnMap = roleService.queryBindPrivilege(code);
        return returnMap;
    }

    */
/**
     *  绑定权限
     * @param code
     * @param privileges
     * @return
     *//*

    @PostMapping(value = "/role/bindPrivilege/{code}")
    public Map<String, Object> bindPrivilege(@PathVariable("code") String code, @RequestBody List<String> privileges) {
        Map<String, Object> returnMap = roleService.bindPrivilege(code, privileges);
        return returnMap;
    }
}
*/
